package cn.iocoder.yudao.module.shop.dal.mysql.manager;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.shop.dal.dataobject.manager.ShopManagerDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.manager.vo.*;

/**
 * 店铺管理员 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface ShopManagerMapper extends BaseMapperX<ShopManagerDO> {

    default PageResult<ShopManagerDO> selectPage(ShopManagerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopManagerDO>()
                .eqIfPresent(ShopManagerDO::getMobile, reqVO.getMobile())
                .betweenIfPresent(ShopManagerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopManagerDO::getId));
    }

    default List<ShopManagerDO> selectList(ShopManagerExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ShopManagerDO>()
                .eqIfPresent(ShopManagerDO::getMobile, reqVO.getMobile())
                .betweenIfPresent(ShopManagerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopManagerDO::getId));
    }

}
